<?php
/**
 * Created by PhpStorm.
 * User: divya
 * Date: 2018/7/25
 * Time: 下午4:05
 */

namespace app\api\model;

class Banner extends BaseModel
{
    public function items(){
        return $this->hasMany('BannerItem','banner_id','id');
    }
    public static function getBannerById($id)
    {
        // TODO: 根据Banner id号，获取banner信息
        $result = self::with(['items','items.img'])->find($id);
        return $result;
    }

}